﻿CREATE TABLE [dbo].[AB_list] (
    [id]        INT             IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [CompanyId] INT             CONSTRAINT [DF_AB_list_CompanyId] DEFAULT ((0)) NULL,
    [Iid]       INT             CONSTRAINT [DF_AB_list_Iid] DEFAULT ((0)) NULL,
    [AB_Type]   INT             CONSTRAINT [DF_AB_list_Btemp] DEFAULT ((0)) NULL,
    [je]        DECIMAL (18, 2) CONSTRAINT [DF_AB_list_Amount] DEFAULT ((0)) NULL,
    [ye]        DECIMAL (18, 2) CONSTRAINT [DF_AB_list_Balance] DEFAULT ((0)) NULL,
    [UpTime]    SMALLDATETIME   CONSTRAINT [DF_AB_list_UpTime] DEFAULT (getdate()) NULL,
    [Person]    NVARCHAR (30)   CONSTRAINT [DF_AB_list_Person] DEFAULT ('') NULL,
    [Items]     INT             CONSTRAINT [DF_AB_list_Items] DEFAULT ((0)) NULL,
    [rootId]    INT             CONSTRAINT [DF_AB_list_rootId] DEFAULT ((2)) NULL,
    [syzh]      INT             CONSTRAINT [DF_AB_list_syzh] DEFAULT ((0)) NULL,
    CONSTRAINT [PK_AB_list] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_AB_list_UpTime]
    ON [dbo].[AB_list]([UpTime] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_AB_list_CompanyId]
    ON [dbo].[AB_list]([CompanyId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_AB_list_Iid]
    ON [dbo].[AB_list]([Iid] ASC);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_AB_list_0cb7350a9ce8487e925f8445ef6b7ea6]
    ON [dbo].[AB_list]([Iid] ASC, [AB_Type] ASC)
    INCLUDE([ye], [UpTime]);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'账号ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'Iid';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'金额类别  1收入 0支出', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'AB_Type';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'总金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'je';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'余额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'ye';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'更新时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'UpTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'经手人', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'Person';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'业务笔数', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'Items';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'1代表一级 2 代表二级', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AB_list', @level2type = N'COLUMN', @level2name = N'rootId';

